// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Google Cloud Pub/Sub API Version v1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://cloud.google.com/pubsub/docs'>Google Cloud Pub/Sub API</a>
 *      <tr><th>API Version<td>v1
 *      <tr><th>API Rev<td>20170308 (797)
 *      <tr><th>API Docs
 *          <td><a href='https://cloud.google.com/pubsub/docs'>
 *              https://cloud.google.com/pubsub/docs</a>
 *      <tr><th>Discovery Name<td>pubsub
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Google Cloud Pub/Sub API can be found at
 * <a href='https://cloud.google.com/pubsub/docs'>https://cloud.google.com/pubsub/docs</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Pubsub.v1
{
    /// <summary>The Pubsub Service.</summary>
    public class PubsubService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public PubsubService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public PubsubService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            projects = new ProjectsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "pubsub"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://pubsub.googleapis.com/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return ""; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Google Cloud Pub/Sub API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

            /// <summary>View and manage Pub/Sub topics and subscriptions</summary>
            public static string Pubsub = "https://www.googleapis.com/auth/pubsub";

        }



        private readonly ProjectsResource projects;

        /// <summary>Gets the Projects resource.</summary>
        public virtual ProjectsResource Projects
        {
            get { return projects; }
        }
    }

    ///<summary>A base abstract class for Pubsub requests.</summary>
    public abstract class PubsubBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new PubsubBaseServiceRequest instance.</summary>
        protected PubsubBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>V1 error format.</summary>
        [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<XgafvEnum> Xgafv { get; set; }

        /// <summary>V1 error format.</summary>
        public enum XgafvEnum
        {
            /// <summary>v1 error format</summary>
            [Google.Apis.Util.StringValueAttribute("1")]
            Value1,
            /// <summary>v2 error format</summary>
            [Google.Apis.Util.StringValueAttribute("2")]
            Value2,
        }

        /// <summary>OAuth access token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string AccessToken { get; set; }

        /// <summary>Data format for response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
            /// <summary>Media download with context-dependent Content-Type</summary>
            [Google.Apis.Util.StringValueAttribute("media")]
            Media,
            /// <summary>Responses with Content-Type of application/x-protobuf</summary>
            [Google.Apis.Util.StringValueAttribute("proto")]
            Proto,
        }

        /// <summary>OAuth bearer token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("bearer_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string BearerToken { get; set; }

        /// <summary>JSONP</summary>
        [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Callback { get; set; }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Pretty-print response.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("pp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> Pp { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadType { get; set; }

        /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadProtocol { get; set; }

        /// <summary>Initializes Pubsub parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "$.xgafv", new Google.Apis.Discovery.Parameter
                {
                    Name = "$.xgafv",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "access_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "access_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "bearer_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "bearer_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "callback", new Google.Apis.Discovery.Parameter
                {
                    Name = "callback",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "pp", new Google.Apis.Discovery.Parameter
                {
                    Name = "pp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "uploadType", new Google.Apis.Discovery.Parameter
                {
                    Name = "uploadType",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "upload_protocol", new Google.Apis.Discovery.Parameter
                {
                    Name = "upload_protocol",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "projects" collection of methods.</summary>
    public class ProjectsResource
    {
        private const string Resource = "projects";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ProjectsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            snapshots = new SnapshotsResource(service);
            subscriptions = new SubscriptionsResource(service);
            topics = new TopicsResource(service);

        }

        private readonly SnapshotsResource snapshots;

        /// <summary>Gets the Snapshots resource.</summary>
        public virtual SnapshotsResource Snapshots
        {
            get { return snapshots; }
        }

        /// <summary>The "snapshots" collection of methods.</summary>
        public class SnapshotsResource
        {
            private const string Resource = "snapshots";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SnapshotsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource exists
            /// and does not have a policy set.</summary>
            /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual GetIamPolicyRequest GetIamPolicy(string resource)
            {
                return new GetIamPolicyRequest(service, resource);
            }

            /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource exists
            /// and does not have a policy set.</summary>
            public class GetIamPolicyRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Policy>
            {
                /// <summary>Constructs a new GetIamPolicy request.</summary>
                public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource)
                    : base(service)
                {
                    Resource = resource;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "getIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:getIamPolicy"; }
                }

                /// <summary>Initializes GetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/snapshots/[^/]+$",
                        });
                }

            }

            /// <summary>Sets the access control policy on the specified resource. Replaces any existing
            /// policy.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest body, string resource)
            {
                return new SetIamPolicyRequest(service, body, resource);
            }

            /// <summary>Sets the access control policy on the specified resource. Replaces any existing
            /// policy.</summary>
            public class SetIamPolicyRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Policy>
            {
                /// <summary>Constructs a new SetIamPolicy request.</summary>
                public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "setIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:setIamPolicy"; }
                }

                /// <summary>Initializes SetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/snapshots/[^/]+$",
                        });
                }

            }

            /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not
            /// exist, this will return an empty set of permissions, not a NOT_FOUND error.
            ///
            /// Note: This operation is designed to be used for building permission-aware UIs and command-line tools,
            /// not for authorization checking. This operation may "fail open" without warning.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest body, string resource)
            {
                return new TestIamPermissionsRequest(service, body, resource);
            }

            /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not
            /// exist, this will return an empty set of permissions, not a NOT_FOUND error.
            ///
            /// Note: This operation is designed to be used for building permission-aware UIs and command-line tools,
            /// not for authorization checking. This operation may "fail open" without warning.</summary>
            public class TestIamPermissionsRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.TestIamPermissionsResponse>
            {
                /// <summary>Constructs a new TestIamPermissions request.</summary>
                public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "testIamPermissions"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:testIamPermissions"; }
                }

                /// <summary>Initializes TestIamPermissions parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/snapshots/[^/]+$",
                        });
                }

            }
        }
        private readonly SubscriptionsResource subscriptions;

        /// <summary>Gets the Subscriptions resource.</summary>
        public virtual SubscriptionsResource Subscriptions
        {
            get { return subscriptions; }
        }

        /// <summary>The "subscriptions" collection of methods.</summary>
        public class SubscriptionsResource
        {
            private const string Resource = "subscriptions";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SubscriptionsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The
            /// Pub/Sub system can remove the relevant messages from the subscription.
            ///
            /// Acknowledging a message whose ack deadline has expired may succeed, but such a message may be
            /// redelivered later. Acknowledging a message more than once will not result in an error.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="subscription">The subscription whose message is being acknowledged. Format is
            /// `projects/{project}/subscriptions/{sub}`.</param>
            public virtual AcknowledgeRequest Acknowledge(Google.Apis.Pubsub.v1.Data.AcknowledgeRequest body, string subscription)
            {
                return new AcknowledgeRequest(service, body, subscription);
            }

            /// <summary>Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The
            /// Pub/Sub system can remove the relevant messages from the subscription.
            ///
            /// Acknowledging a message whose ack deadline has expired may succeed, but such a message may be
            /// redelivered later. Acknowledging a message more than once will not result in an error.</summary>
            public class AcknowledgeRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Empty>
            {
                /// <summary>Constructs a new Acknowledge request.</summary>
                public AcknowledgeRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.AcknowledgeRequest body, string subscription)
                    : base(service)
                {
                    Subscription = subscription;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The subscription whose message is being acknowledged. Format is
                /// `projects/{project}/subscriptions/{sub}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("subscription", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Subscription { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.AcknowledgeRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "acknowledge"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+subscription}:acknowledge"; }
                }

                /// <summary>Initializes Acknowledge parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "subscription", new Google.Apis.Discovery.Parameter
                        {
                            Name = "subscription",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Creates a subscription to a given topic. If the subscription already exists, returns
            /// `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`.
            ///
            /// If the name is not provided in the request, the server will assign a random name for this subscription
            /// on the same project as the topic, conforming to the [resource name
            /// format](https://cloud.google.com/pubsub/docs/overview#names). The generated name is populated in the
            /// returned Subscription object. Note that for REST API requests, you must specify a name in the
            /// request.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="name">The name of the subscription. It must have the format
            /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only
            /// letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or
            /// percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with
            /// `"goog"`.</param>
            public virtual CreateRequest Create(Google.Apis.Pubsub.v1.Data.Subscription body, string name)
            {
                return new CreateRequest(service, body, name);
            }

            /// <summary>Creates a subscription to a given topic. If the subscription already exists, returns
            /// `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`.
            ///
            /// If the name is not provided in the request, the server will assign a random name for this subscription
            /// on the same project as the topic, conforming to the [resource name
            /// format](https://cloud.google.com/pubsub/docs/overview#names). The generated name is populated in the
            /// returned Subscription object. Note that for REST API requests, you must specify a name in the
            /// request.</summary>
            public class CreateRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Subscription>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.Subscription body, string name)
                    : base(service)
                {
                    Name = name;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The name of the subscription. It must have the format
                /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and
                /// contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods
                /// (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in
                /// length, and it must not start with `"goog"`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.Subscription Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Deletes an existing subscription. All messages retained in the subscription are immediately
            /// dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new
            /// one may be created with the same name, but the new one has no association with the old subscription or
            /// its topic unless the same topic is specified.</summary>
            /// <param name="subscription">The subscription to delete. Format is
            /// `projects/{project}/subscriptions/{sub}`.</param>
            public virtual DeleteRequest Delete(string subscription)
            {
                return new DeleteRequest(service, subscription);
            }

            /// <summary>Deletes an existing subscription. All messages retained in the subscription are immediately
            /// dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new
            /// one may be created with the same name, but the new one has no association with the old subscription or
            /// its topic unless the same topic is specified.</summary>
            public class DeleteRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string subscription)
                    : base(service)
                {
                    Subscription = subscription;
                    InitParameters();
                }


                /// <summary>The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("subscription", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Subscription { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+subscription}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "subscription", new Google.Apis.Discovery.Parameter
                        {
                            Name = "subscription",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Gets the configuration details of a subscription.</summary>
            /// <param name="subscription">The name of the subscription to get. Format is
            /// `projects/{project}/subscriptions/{sub}`.</param>
            public virtual GetRequest Get(string subscription)
            {
                return new GetRequest(service, subscription);
            }

            /// <summary>Gets the configuration details of a subscription.</summary>
            public class GetRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Subscription>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string subscription)
                    : base(service)
                {
                    Subscription = subscription;
                    InitParameters();
                }


                /// <summary>The name of the subscription to get. Format is
                /// `projects/{project}/subscriptions/{sub}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("subscription", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Subscription { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+subscription}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "subscription", new Google.Apis.Discovery.Parameter
                        {
                            Name = "subscription",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource exists
            /// and does not have a policy set.</summary>
            /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual GetIamPolicyRequest GetIamPolicy(string resource)
            {
                return new GetIamPolicyRequest(service, resource);
            }

            /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource exists
            /// and does not have a policy set.</summary>
            public class GetIamPolicyRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Policy>
            {
                /// <summary>Constructs a new GetIamPolicy request.</summary>
                public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource)
                    : base(service)
                {
                    Resource = resource;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "getIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:getIamPolicy"; }
                }

                /// <summary>Initializes GetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Lists matching subscriptions.</summary>
            /// <param name="project">The name of the cloud project that subscriptions belong to. Format is
            /// `projects/{project}`.</param>
            public virtual ListRequest List(string project)
            {
                return new ListRequest(service, project);
            }

            /// <summary>Lists matching subscriptions.</summary>
            public class ListRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.ListSubscriptionsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string project)
                    : base(service)
                {
                    Project = project;
                    InitParameters();
                }


                /// <summary>The name of the cloud project that subscriptions belong to. Format is
                /// `projects/{project}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Project { get; private set; }

                /// <summary>The value returned by the last `ListSubscriptionsResponse`; indicates that this is a
                /// continuation of a prior `ListSubscriptions` call, and that the system should return the next page of
                /// data.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Maximum number of subscriptions to return.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+project}/subscriptions"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "project", new Google.Apis.Discovery.Parameter
                        {
                            Name = "project",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Modifies the ack deadline for a specific message. This method is useful to indicate that more
            /// time is needed to process a message by the subscriber, or to make the message available for redelivery
            /// if the processing was interrupted. Note that this does not modify the subscription-level
            /// `ackDeadlineSeconds` used for subsequent messages.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="subscription">The name of the subscription. Format is
            /// `projects/{project}/subscriptions/{sub}`.</param>
            public virtual ModifyAckDeadlineRequest ModifyAckDeadline(Google.Apis.Pubsub.v1.Data.ModifyAckDeadlineRequest body, string subscription)
            {
                return new ModifyAckDeadlineRequest(service, body, subscription);
            }

            /// <summary>Modifies the ack deadline for a specific message. This method is useful to indicate that more
            /// time is needed to process a message by the subscriber, or to make the message available for redelivery
            /// if the processing was interrupted. Note that this does not modify the subscription-level
            /// `ackDeadlineSeconds` used for subsequent messages.</summary>
            public class ModifyAckDeadlineRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Empty>
            {
                /// <summary>Constructs a new ModifyAckDeadline request.</summary>
                public ModifyAckDeadlineRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.ModifyAckDeadlineRequest body, string subscription)
                    : base(service)
                {
                    Subscription = subscription;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("subscription", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Subscription { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.ModifyAckDeadlineRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "modifyAckDeadline"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+subscription}:modifyAckDeadline"; }
                }

                /// <summary>Initializes ModifyAckDeadline parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "subscription", new Google.Apis.Discovery.Parameter
                        {
                            Name = "subscription",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Modifies the `PushConfig` for a specified subscription.
            ///
            /// This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or
            /// vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will
            /// accumulate for delivery continuously through the call regardless of changes to the
            /// `PushConfig`.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="subscription">The name of the subscription. Format is
            /// `projects/{project}/subscriptions/{sub}`.</param>
            public virtual ModifyPushConfigRequest ModifyPushConfig(Google.Apis.Pubsub.v1.Data.ModifyPushConfigRequest body, string subscription)
            {
                return new ModifyPushConfigRequest(service, body, subscription);
            }

            /// <summary>Modifies the `PushConfig` for a specified subscription.
            ///
            /// This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or
            /// vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will
            /// accumulate for delivery continuously through the call regardless of changes to the
            /// `PushConfig`.</summary>
            public class ModifyPushConfigRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Empty>
            {
                /// <summary>Constructs a new ModifyPushConfig request.</summary>
                public ModifyPushConfigRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.ModifyPushConfigRequest body, string subscription)
                    : base(service)
                {
                    Subscription = subscription;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("subscription", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Subscription { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.ModifyPushConfigRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "modifyPushConfig"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+subscription}:modifyPushConfig"; }
                }

                /// <summary>Initializes ModifyPushConfig parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "subscription", new Google.Apis.Discovery.Parameter
                        {
                            Name = "subscription",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Pulls messages from the server. Returns an empty list if there are no messages available in the
            /// backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for
            /// the given subscription.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="subscription">The subscription from which messages should be pulled. Format is
            /// `projects/{project}/subscriptions/{sub}`.</param>
            public virtual PullRequest Pull(Google.Apis.Pubsub.v1.Data.PullRequest body, string subscription)
            {
                return new PullRequest(service, body, subscription);
            }

            /// <summary>Pulls messages from the server. Returns an empty list if there are no messages available in the
            /// backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for
            /// the given subscription.</summary>
            public class PullRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.PullResponse>
            {
                /// <summary>Constructs a new Pull request.</summary>
                public PullRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.PullRequest body, string subscription)
                    : base(service)
                {
                    Subscription = subscription;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The subscription from which messages should be pulled. Format is
                /// `projects/{project}/subscriptions/{sub}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("subscription", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Subscription { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.PullRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "pull"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+subscription}:pull"; }
                }

                /// <summary>Initializes Pull parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "subscription", new Google.Apis.Discovery.Parameter
                        {
                            Name = "subscription",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Sets the access control policy on the specified resource. Replaces any existing
            /// policy.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest body, string resource)
            {
                return new SetIamPolicyRequest(service, body, resource);
            }

            /// <summary>Sets the access control policy on the specified resource. Replaces any existing
            /// policy.</summary>
            public class SetIamPolicyRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Policy>
            {
                /// <summary>Constructs a new SetIamPolicy request.</summary>
                public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "setIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:setIamPolicy"; }
                }

                /// <summary>Initializes SetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }

            /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not
            /// exist, this will return an empty set of permissions, not a NOT_FOUND error.
            ///
            /// Note: This operation is designed to be used for building permission-aware UIs and command-line tools,
            /// not for authorization checking. This operation may "fail open" without warning.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest body, string resource)
            {
                return new TestIamPermissionsRequest(service, body, resource);
            }

            /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not
            /// exist, this will return an empty set of permissions, not a NOT_FOUND error.
            ///
            /// Note: This operation is designed to be used for building permission-aware UIs and command-line tools,
            /// not for authorization checking. This operation may "fail open" without warning.</summary>
            public class TestIamPermissionsRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.TestIamPermissionsResponse>
            {
                /// <summary>Constructs a new TestIamPermissions request.</summary>
                public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "testIamPermissions"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:testIamPermissions"; }
                }

                /// <summary>Initializes TestIamPermissions parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/subscriptions/[^/]+$",
                        });
                }

            }
        }
        private readonly TopicsResource topics;

        /// <summary>Gets the Topics resource.</summary>
        public virtual TopicsResource Topics
        {
            get { return topics; }
        }

        /// <summary>The "topics" collection of methods.</summary>
        public class TopicsResource
        {
            private const string Resource = "topics";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public TopicsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;
                subscriptions = new SubscriptionsResource(service);

            }

            private readonly SubscriptionsResource subscriptions;

            /// <summary>Gets the Subscriptions resource.</summary>
            public virtual SubscriptionsResource Subscriptions
            {
                get { return subscriptions; }
            }

            /// <summary>The "subscriptions" collection of methods.</summary>
            public class SubscriptionsResource
            {
                private const string Resource = "subscriptions";

                /// <summary>The service which this resource belongs to.</summary>
                private readonly Google.Apis.Services.IClientService service;

                /// <summary>Constructs a new resource.</summary>
                public SubscriptionsResource(Google.Apis.Services.IClientService service)
                {
                    this.service = service;

                }


                /// <summary>Lists the name of the subscriptions for this topic.</summary>
                /// <param name="topic">The name of the topic that subscriptions are attached to. Format is
                /// `projects/{project}/topics/{topic}`.</param>
                public virtual ListRequest List(string topic)
                {
                    return new ListRequest(service, topic);
                }

                /// <summary>Lists the name of the subscriptions for this topic.</summary>
                public class ListRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.ListTopicSubscriptionsResponse>
                {
                    /// <summary>Constructs a new List request.</summary>
                    public ListRequest(Google.Apis.Services.IClientService service, string topic)
                        : base(service)
                    {
                        Topic = topic;
                        InitParameters();
                    }


                    /// <summary>The name of the topic that subscriptions are attached to. Format is
                    /// `projects/{project}/topics/{topic}`.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("topic", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string Topic { get; private set; }

                    /// <summary>The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is
                    /// a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the
                    /// next page of data.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual string PageToken { get; set; }

                    /// <summary>Maximum number of subscription names to return.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<int> PageSize { get; set; }


                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "list"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "GET"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "v1/{+topic}/subscriptions"; }
                    }

                    /// <summary>Initializes List parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "topic", new Google.Apis.Discovery.Parameter
                            {
                                Name = "topic",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = @"^projects/[^/]+/topics/[^/]+$",
                            });
                        RequestParameters.Add(
                            "pageToken", new Google.Apis.Discovery.Parameter
                            {
                                Name = "pageToken",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "pageSize", new Google.Apis.Discovery.Parameter
                            {
                                Name = "pageSize",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                    }

                }
            }

            /// <summary>Creates the given topic with the given name.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="name">The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}`
            /// must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`),
            /// periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length,
            /// and it must not start with `"goog"`.</param>
            public virtual CreateRequest Create(Google.Apis.Pubsub.v1.Data.Topic body, string name)
            {
                return new CreateRequest(service, body, name);
            }

            /// <summary>Creates the given topic with the given name.</summary>
            public class CreateRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Topic>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.Topic body, string name)
                    : base(service)
                {
                    Name = name;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`.
                /// `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes
                /// (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be
                /// between 3 and 255 characters in length, and it must not start with `"goog"`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.Topic Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }

            /// <summary>Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
            /// topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none
            /// of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but
            /// their `topic` field is set to `_deleted-topic_`.</summary>
            /// <param name="topic">Name of the topic to delete. Format is `projects/{project}/topics/{topic}`.</param>
            public virtual DeleteRequest Delete(string topic)
            {
                return new DeleteRequest(service, topic);
            }

            /// <summary>Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
            /// topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none
            /// of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but
            /// their `topic` field is set to `_deleted-topic_`.</summary>
            public class DeleteRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string topic)
                    : base(service)
                {
                    Topic = topic;
                    InitParameters();
                }


                /// <summary>Name of the topic to delete. Format is `projects/{project}/topics/{topic}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("topic", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Topic { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+topic}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "topic", new Google.Apis.Discovery.Parameter
                        {
                            Name = "topic",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }

            /// <summary>Gets the configuration of a topic.</summary>
            /// <param name="topic">The name of the topic to get. Format is `projects/{project}/topics/{topic}`.</param>
            public virtual GetRequest Get(string topic)
            {
                return new GetRequest(service, topic);
            }

            /// <summary>Gets the configuration of a topic.</summary>
            public class GetRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Topic>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string topic)
                    : base(service)
                {
                    Topic = topic;
                    InitParameters();
                }


                /// <summary>The name of the topic to get. Format is `projects/{project}/topics/{topic}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("topic", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Topic { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+topic}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "topic", new Google.Apis.Discovery.Parameter
                        {
                            Name = "topic",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }

            /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource exists
            /// and does not have a policy set.</summary>
            /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual GetIamPolicyRequest GetIamPolicy(string resource)
            {
                return new GetIamPolicyRequest(service, resource);
            }

            /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource exists
            /// and does not have a policy set.</summary>
            public class GetIamPolicyRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Policy>
            {
                /// <summary>Constructs a new GetIamPolicy request.</summary>
                public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource)
                    : base(service)
                {
                    Resource = resource;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "getIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:getIamPolicy"; }
                }

                /// <summary>Initializes GetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }

            /// <summary>Lists matching topics.</summary>
            /// <param name="project">The name of the cloud project that topics belong to. Format is
            /// `projects/{project}`.</param>
            public virtual ListRequest List(string project)
            {
                return new ListRequest(service, project);
            }

            /// <summary>Lists matching topics.</summary>
            public class ListRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.ListTopicsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string project)
                    : base(service)
                {
                    Project = project;
                    InitParameters();
                }


                /// <summary>The name of the cloud project that topics belong to. Format is
                /// `projects/{project}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Project { get; private set; }

                /// <summary>The value returned by the last `ListTopicsResponse`; indicates that this is a continuation
                /// of a prior `ListTopics` call, and that the system should return the next page of data.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Maximum number of topics to return.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+project}/topics"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "project", new Google.Apis.Discovery.Parameter
                        {
                            Name = "project",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The
            /// message payload must not be empty; it must contain either a non-empty data field, or at least one
            /// attribute.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="topic">The messages in the request will be published on this topic. Format is
            /// `projects/{project}/topics/{topic}`.</param>
            public virtual PublishRequest Publish(Google.Apis.Pubsub.v1.Data.PublishRequest body, string topic)
            {
                return new PublishRequest(service, body, topic);
            }

            /// <summary>Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The
            /// message payload must not be empty; it must contain either a non-empty data field, or at least one
            /// attribute.</summary>
            public class PublishRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.PublishResponse>
            {
                /// <summary>Constructs a new Publish request.</summary>
                public PublishRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.PublishRequest body, string topic)
                    : base(service)
                {
                    Topic = topic;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The messages in the request will be published on this topic. Format is
                /// `projects/{project}/topics/{topic}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("topic", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Topic { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.PublishRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "publish"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+topic}:publish"; }
                }

                /// <summary>Initializes Publish parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "topic", new Google.Apis.Discovery.Parameter
                        {
                            Name = "topic",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }

            /// <summary>Sets the access control policy on the specified resource. Replaces any existing
            /// policy.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest body, string resource)
            {
                return new SetIamPolicyRequest(service, body, resource);
            }

            /// <summary>Sets the access control policy on the specified resource. Replaces any existing
            /// policy.</summary>
            public class SetIamPolicyRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.Policy>
            {
                /// <summary>Constructs a new SetIamPolicy request.</summary>
                public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.SetIamPolicyRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "setIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:setIamPolicy"; }
                }

                /// <summary>Initializes SetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }

            /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not
            /// exist, this will return an empty set of permissions, not a NOT_FOUND error.
            ///
            /// Note: This operation is designed to be used for building permission-aware UIs and command-line tools,
            /// not for authorization checking. This operation may "fail open" without warning.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation
            /// documentation for the appropriate value for this field.</param>
            public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest body, string resource)
            {
                return new TestIamPermissionsRequest(service, body, resource);
            }

            /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not
            /// exist, this will return an empty set of permissions, not a NOT_FOUND error.
            ///
            /// Note: This operation is designed to be used for building permission-aware UIs and command-line tools,
            /// not for authorization checking. This operation may "fail open" without warning.</summary>
            public class TestIamPermissionsRequest : PubsubBaseServiceRequest<Google.Apis.Pubsub.v1.Data.TestIamPermissionsResponse>
            {
                /// <summary>Constructs a new TestIamPermissions request.</summary>
                public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the operation
                /// documentation for the appropriate value for this field.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Pubsub.v1.Data.TestIamPermissionsRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "testIamPermissions"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:testIamPermissions"; }
                }

                /// <summary>Initializes TestIamPermissions parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/topics/[^/]+$",
                        });
                }

            }
        }
    }
}

namespace Google.Apis.Pubsub.v1.Data
{    

    /// <summary>Request for the Acknowledge method.</summary>
    public class AcknowledgeRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The acknowledgment ID for the messages being acknowledged that was returned by the Pub/Sub system
        /// in the `Pull` response. Must not be empty.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("ackIds")]
        public virtual System.Collections.Generic.IList<string> AckIds { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Associates `members` with a `role`.</summary>
    public class Binding : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Specifies the identities requesting access for a Cloud Platform resource. `members` can have the
        /// following values:
        ///
        /// * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google
        /// account.
        ///
        /// * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google
        /// account or a service account.
        ///
        /// * `user:{emailid}`: An email address that represents a specific Google account. For example,
        /// `alice@gmail.com` or `joe@example.com`.
        ///
        /// * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-
        /// app@appspot.gserviceaccount.com`.
        ///
        /// * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
        ///
        /// * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example,
        /// `google.com` or `example.com`.
        ///
        /// </summary>
        [Newtonsoft.Json.JsonPropertyAttribute("members")]
        public virtual System.Collections.Generic.IList<string> Members { get; set; } 

        /// <summary>Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
        /// Required</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("role")]
        public virtual string Role { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A
    /// typical example is to use it as the request or the response type of an API method. For instance:
    ///
    /// service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    ///
    /// The JSON representation for `Empty` is empty JSON object `{}`.</summary>
    public class Empty : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response for the `ListSubscriptions` method.</summary>
    public class ListSubscriptionsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If not empty, indicates that there may be more subscriptions that match the request; this value
        /// should be passed in a new `ListSubscriptionsRequest` to get more subscriptions.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The subscriptions that match the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("subscriptions")]
        public virtual System.Collections.Generic.IList<Subscription> Subscriptions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response for the `ListTopicSubscriptions` method.</summary>
    public class ListTopicSubscriptionsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If not empty, indicates that there may be more subscriptions that match the request; this value
        /// should be passed in a new `ListTopicSubscriptionsRequest` to get more subscriptions.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The names of the subscriptions that match the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("subscriptions")]
        public virtual System.Collections.Generic.IList<string> Subscriptions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response for the `ListTopics` method.</summary>
    public class ListTopicsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If not empty, indicates that there may be more topics that match the request; this value should be
        /// passed in a new `ListTopicsRequest`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The resulting topics.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("topics")]
        public virtual System.Collections.Generic.IList<Topic> Topics { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request for the ModifyAckDeadline method.</summary>
    public class ModifyAckDeadlineRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The new ack deadline with respect to the time this request was sent to the Pub/Sub system. For
        /// example, if the value is 10, the new ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
        /// was made. Specifying zero may immediately make the message available for another pull request. The minimum
        /// deadline you can specify is 0 seconds. The maximum deadline you can specify is 600 seconds (10
        /// minutes).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("ackDeadlineSeconds")]
        public virtual System.Nullable<int> AckDeadlineSeconds { get; set; } 

        /// <summary>List of acknowledgment IDs.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("ackIds")]
        public virtual System.Collections.Generic.IList<string> AckIds { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request for the ModifyPushConfig method.</summary>
    public class ModifyPushConfigRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The push configuration for future deliveries.
        ///
        /// An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages from the given
        /// subscription and allow messages to be pulled and acknowledged - effectively pausing the subscription if
        /// `Pull` is not called.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("pushConfig")]
        public virtual PushConfig PushConfig { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies
    /// for Cloud Platform resources.
    ///
    /// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the
    /// members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of
    /// permissions defined by IAM.
    ///
    /// **Example**
    ///
    /// { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com",
    /// "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer",
    /// "members": ["user:sean@example.com"] } ] }
    ///
    /// For a description of IAM and its features, see the [IAM developer's
    /// guide](https://cloud.google.com/iam).</summary>
    public class Policy : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same
        /// `role`. `bindings` with no members will result in an error.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bindings")]
        public virtual System.Collections.Generic.IList<Binding> Bindings { get; set; } 

        /// <summary>`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of
        /// a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the
        /// read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned
        /// in the response to `getIamPolicy`, and systems are expected to put that etag in the request to
        /// `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
        ///
        /// If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten
        /// blindly.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        /// <summary>Version of the `Policy`. The default version is 0.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("version")]
        public virtual System.Nullable<int> Version { get; set; } 

    }    

    /// <summary>Request for the Publish method.</summary>
    public class PublishRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The messages to publish.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("messages")]
        public virtual System.Collections.Generic.IList<PubsubMessage> Messages { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response for the `Publish` method.</summary>
    public class PublishResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The server-assigned ID of each published message, in the same order as the messages in the request.
        /// IDs are guaranteed to be unique within the topic.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("messageIds")]
        public virtual System.Collections.Generic.IList<string> MessageIds { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A message data and its attributes. The message payload must not be empty; it must contain either a non-
    /// empty data field, or at least one attribute.</summary>
    public class PubsubMessage : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional attributes for this message.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("attributes")]
        public virtual System.Collections.Generic.IDictionary<string,string> Attributes { get; set; } 

        /// <summary>The message payload.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("data")]
        public virtual string Data { get; set; } 

        /// <summary>ID of this message, assigned by the server when the message is published. Guaranteed to be unique
        /// within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call
        /// or a push delivery. It must not be populated by the publisher in a `Publish` call.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("messageId")]
        public virtual string MessageId { get; set; } 

        /// <summary>The time at which the message was published, populated by the server when it receives the `Publish`
        /// call. It must not be populated by the publisher in a `Publish` call.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("publishTime")]
        public virtual object PublishTime { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request for the `Pull` method.</summary>
    public class PullRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The maximum number of messages returned for this request. The Pub/Sub system may return fewer than
        /// the number specified.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("maxMessages")]
        public virtual System.Nullable<int> MaxMessages { get; set; } 

        /// <summary>If this field set to true, the system will respond immediately even if it there are no messages
        /// available to return in the `Pull` response. Otherwise, the system may wait (for a bounded amount of time)
        /// until at least one message is available, rather than returning no messages. The client may cancel the
        /// request if it does not wish to wait any longer for the response.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("returnImmediately")]
        public virtual System.Nullable<bool> ReturnImmediately { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response for the `Pull` method.</summary>
    public class PullResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Received Pub/Sub messages. The Pub/Sub system will return zero messages if there are no more
        /// available in the backlog. The Pub/Sub system may return fewer than the `maxMessages` requested even if there
        /// are more messages available in the backlog.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("receivedMessages")]
        public virtual System.Collections.Generic.IList<ReceivedMessage> ReceivedMessages { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Configuration for a push delivery endpoint.</summary>
    public class PushConfig : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Endpoint configuration attributes.
        ///
        /// Every endpoint has a set of API supported attributes that can be used to control different aspects of the
        /// message delivery.
        ///
        /// The currently supported attribute is `x-goog-version`, which you can use to change the format of the pushed
        /// message. This attribute indicates the version of the data expected by the endpoint. This controls the shape
        /// of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the
        /// Pub/Sub API.
        ///
        /// If not present during the `CreateSubscription` call, it will default to the version of the API used to make
        /// such call. If not present during a `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
        /// calls will always return a valid version, even if the subscription was created without this attribute.
        ///
        /// The possible values for this attribute are:
        ///
        /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push
        /// format defined in the v1 Pub/Sub API.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("attributes")]
        public virtual System.Collections.Generic.IDictionary<string,string> Attributes { get; set; } 

        /// <summary>A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint
        /// might use "https://example.com/push".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("pushEndpoint")]
        public virtual string PushEndpoint { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A message and its corresponding acknowledgment ID.</summary>
    public class ReceivedMessage : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>This ID can be used to acknowledge the received message.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("ackId")]
        public virtual string AckId { get; set; } 

        /// <summary>The message.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("message")]
        public virtual PubsubMessage Message { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request message for `SetIamPolicy` method.</summary>
    public class SetIamPolicyRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to
        /// a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects)
        /// might reject them.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("policy")]
        public virtual Policy Policy { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A subscription resource.</summary>
    public class Subscription : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>This value is the maximum time after a subscriber receives a message before the subscriber should
        /// acknowledge the message. After message delivery but before the ack deadline expires and before the message
        /// is acknowledged, it is an outstanding message and will not be delivered again during that time (on a best-
        /// effort basis).
        ///
        /// For pull subscriptions, this value is used as the initial value for the ack deadline. To override this value
        /// for a given message, call `ModifyAckDeadline` with the corresponding `ack_id` if using pull. The minimum
        /// custom deadline you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds
        /// (10 minutes). If this parameter is 0, a default value of 10 seconds is used.
        ///
        /// For push delivery, this value is also used to set the request timeout for the call to the push endpoint.
        ///
        /// If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the
        /// message.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("ackDeadlineSeconds")]
        public virtual System.Nullable<int> AckDeadlineSeconds { get; set; } 

        /// <summary>The name of the subscription. It must have the format
        /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain
        /// only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
        /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start
        /// with `"goog"`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>If push delivery is used with this subscription, this field is used to configure it. An empty
        /// `pushConfig` signifies that the subscriber will pull and ack messages using API methods.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("pushConfig")]
        public virtual PushConfig PushConfig { get; set; } 

        /// <summary>The name of the topic from which this subscription is receiving messages. Format is
        /// `projects/{project}/topics/{topic}`. The value of this field will be `_deleted-topic_` if the topic has been
        /// deleted.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("topic")]
        public virtual string Topic { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request message for `TestIamPermissions` method.</summary>
    public class TestIamPermissionsRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or
        /// 'storage.*') are not allowed. For more information see [IAM
        /// Overview](https://cloud.google.com/iam/docs/overview#permissions).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("permissions")]
        public virtual System.Collections.Generic.IList<string> Permissions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response message for `TestIamPermissions` method.</summary>
    public class TestIamPermissionsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A subset of `TestPermissionsRequest.permissions` that the caller is allowed.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("permissions")]
        public virtual System.Collections.Generic.IList<string> Permissions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A topic resource.</summary>
    public class Topic : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}`
        /// must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
        /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and
        /// 255 characters in length, and it must not start with `"goog"`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
